package com.bling.common.bean;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 用户基本信息
 * 用户可以使用用户名(邮箱)或者自己设置昵称登录
 * @author BLingSoft
 *
 */
@Entity
@Table(name="T_USERBASIC")
public class UserBasic  implements Serializable{
	private static final long serialVersionUID = 86708348287230676L;
	
	private Integer id;//用户编号
	private String username;//用户名(邮箱)
	private String niname;//自定义昵称
	private String password;//密码
	private boolean isforbiden;//是否禁止 0-正常 1-禁止
	
	private UserDetail userDetail;

	public UserBasic() {
		super();
	}

	public UserBasic(String username, String niname, String password,
			boolean isforbiden) {
		super();
		this.username = username;
		this.niname = niname;
		this.password = password;
		this.isforbiden = isforbiden;
	}

	@Id
	@GeneratedValue
	@Column
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(length=50)
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(length=50)
	public String getNiname() {
		return niname;
	}

	public void setNiname(String niname) {
		this.niname = niname;
	}

	@Column(length=50)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column
	public boolean getIsforbiden() {
		return isforbiden;
	}

	public void setIsforbiden(boolean isforbiden) {
		this.isforbiden = isforbiden;
	}

	@Transient
	public UserDetail getUserDetail() {
		return userDetail;
	}

	public void setUserDetail(UserDetail userDetail) {
		this.userDetail = userDetail;
	}
}
